using System.ComponentModel.DataAnnotations;

namespace RabbitTraceability.Api.Dtos.Request
{
    /// <summary>
    /// 用户注册请求DTO
    /// </summary>
    public class UserRegisterRequestDto
    {
        /// <summary>
        /// 用户名
        /// </summary>
        [Required(ErrorMessage = "用户名不能为空")]
        [StringLength(50, MinimumLength = 3, ErrorMessage = "用户名长度必须在3-50个字符之间")]
        public string Username { get; set; } = string.Empty;

        /// <summary>
        /// 密码
        /// </summary>
        [Required(ErrorMessage = "密码不能为空")]
        [StringLength(50, MinimumLength = 6, ErrorMessage = "密码长度必须在6-50个字符之间")]
        public string Password { get; set; } = string.Empty;

        /// <summary>
        /// 真实姓名
        /// </summary>
        public string? RealName { get; set; }

        /// <summary>
        /// 电子邮箱
        /// </summary>
        [EmailAddress(ErrorMessage = "邮箱格式不正确")]
        public string? Email { get; set; }

        /// <summary>
        /// 性别（0-未知，1-男，2-女）
        /// </summary>
        [Range(0, 2, ErrorMessage = "性别值必须在0-2之间")]
        public int Gender { get; set; } = 0;
    }
}